<?php
// +----------------------------------------------------------------------
// | WoShiMaiJia Projcet 
// +----------------------------------------------------------------------
// | Copyright (c) 2010-2011 http://woshimaijia.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: xinqiyang <xinqiyang@gmail.com>
// +----------------------------------------------------------------------
require_once dirname(dirname(__FILE__))."/TestConfiguration.php";


class SCWSTest extends PHPUnit_Framework_TestCase
{
	//@TODO need to 
	public function testscws(){
		$so = scws_new();
		$so->set_charset('utf8');
		// 这里没有调用 set_dict 和 set_rule 系统会自动试调用 ini 中指定路径下的词典和规则文件
		$so->send_text("我是一个中国人,我会C++语言,我也有很多T恤衣服");
		while ($tmp = $so->get_result())
		{
			print_r($tmp);
		}
		$so->close();

		//例子2. 使用函数提取高频词
		/*
		$sh = scws_open();
		scws_set_charset($sh, 'utf8');
		scws_set_dict($sh, '/path/to/dict.xdb');
		scws_set_rule($sh, '/path/to/rules.ini');
		$text = "我是一个中国人，我会C++语言，我也有很多T恤衣服";
		scws_send_text($sh, $text);
		$top = scws_get_tops($sh, 5);
		print_r($top);
		*/
	}
}